package org.finesys.chat.core.base.embedding;

import java.util.Objects;

public class EmbeddingMatch<Embeded> {
    private final Double score;
    private final String embedingId;
    private final Embedding embedding;
    private final Embeded embeded;
    private final Integer index;

    public EmbeddingMatch(Double score, String embedingId, Embedding embedding, Embeded embeded, Integer index) {
        this.score = score;
        this.embedingId = embedingId;
        this.embedding = embedding;
        this.embeded = embeded;
        this.index = index;
    }

    public Double getScore() {
        return score;
    }

    public String getEmbedingId() {
        return embedingId;
    }

    public Embedding getEmbedding() {
        return embedding;
    }

    public Embeded getEmbeded() {
        return embeded;
    }

    public Integer getIndex() {
        return index;
    }

    @Override
    public boolean equals(Object object) {
        if (this == object) return true;
        if (object == null || getClass() != object.getClass()) return false;
        EmbeddingMatch<?> that = (EmbeddingMatch<?>) object;
        return Objects.equals(score, that.score) && Objects.equals(embedingId, that.embedingId) && Objects.equals(embedding, that.embedding) && Objects.equals(embeded, that.embeded) && Objects.equals(index, that.index);
    }

    @Override
    public int hashCode() {
        return Objects.hash(score, embedingId, embedding, embeded, index);
    }

    @Override
    public String toString() {
        return "EmbeddingMatch{" +
                "score=" + score +
                ", embedingId='" + embedingId + '\'' +
                ", embedding=" + embedding +
                ", embeded=" + embeded +
                ", index=" + index +
                '}';
    }
}
